// 打开显示代码行数模态框
export async function openCodeLinesModal() {
    try {
        const response = await fetch('/get-code-lines'); // 修改请求路径
        const data = await response.json();
        const codeLinesCount = data.codeLines;
        document.getElementById('codeLinesCount').textContent = `整个项目的代码行数为：${codeLinesCount}`;
        const modal=document.getElementById('codeLinesModal');
        modal.classList.add('active');
        document.body.style.overflow = 'hidden';
    } catch (error) {
        console.error('获取代码行数失败:', error);
        alert('获取代码行数失败，请稍后重试');
    }
}

// 关闭显示代码行数模态
export function closeCodeLinesModal() {
    const modal = document.getElementById('codeLinesModal');
    modal.classList.remove('active');
    document.body.style.overflow = '';
}